
from tkinter import * 
from tkinter import ttk
import time as t
root = Tk()
root.geometry('400x400')
#ttk.Spinbox(root,width=20).pack()
ttk.Notebook(root,width=50,height=30).pack()
s=ttk.Progressbar(root,length=100,mode='determinate')

for i in range(5):
	s.start(interval=100)
	#s.step(amount=i*20)
	print(s['value'],end=' ')
	if s['value'] == i*20.0:
	#t.sleep(1)
		s.stop()
	s.variable=i*20
	print(s.variable,end=' ')

	s.pack()
root.mainloop()

#orient,length,mode,maximum,value,variable,phase

'''
import time as t
sr = t.perf_counter()
v = 20
print('{0:-^20}'.format('执行开始'))
for i in range(v+1):
    j = i/2*10
    k = i*'*'
    l = (v-i)*'.'
    sp = t.perf_counter()
    print('\r{:3.0f}%[{}->{}]{:.2f}S'.format(j,k,l,sp),end='')
    t.sleep(0.5)
print('\n{0:-^20}'.format('执行结束'))


s=input()
v=eval(s[0:-2])*2+len(s[0:-2])
s1=s[-1]
print('{0:{1}^{2}}'.format(s[0:-2],s1,v))
'''
'''
i = 2
s = 0
while i < 101:
	if i % 2 == 0:
		s+=i
	else:
		s-=i
	i+=1
print(s)
'''

'''
import getpass
import telnetlib

host = "192.168.0.110"
#host = "193.112.152.28"
user = 'sshtt'#input("Enter your remote account: ")
password = 'zxc.123'#getpass.getpass()


str= r"欢迎使用 Microsoft Telnet Client\n\nEscape 字符为 'CTRL+]'\n\n\n您将要把您的密码信息送到 Internet 区域内的一台远程计算机上。这可能不安\n全。您想发送吗(y/n):"
str = str.encode()

tn = telnetlib.Telnet(host,timeout=2)
#print(tn.read_all().decode())
tn.read_until(str,timeout=2)
tn.write(b'y\n')

#ubuntu下localhost login:
t1=tn.read_until(b"Welcome to Microsoft Telnet Service\n\nlogin:",timeout=2)
#print(t1.decode())
tn.write(user.encode() + b"\n")
#if password:
print(tn.read_until(b"password:",timeout=2).decode())
print(tn.write(password.encode() + b"\n"))

tn.write(b"unmae -r\n")

print(tn.read_lazy())
#var1=var.decode('ascii')
#print(var1)

tn.write(b"exit\n")'''
'''
from tkinter import *

w=Tk()
variable=StringVar(w)
variable.set('操作系统类型')
OptionMenu(w,variable,'------','你好','不好','非常好').pack()
print(variable)
w.mainloop()
'''
'''
def ml(*p):

	#print('类型{} 数据{}'.format(type(mk),mk))
	
	ls=['123','321','1232','1342']
	
	def su(self):
		print(ls[2])
		print('类型为:{} 数据为:{}'.format(type(self),self))
	su(ls)
	
ml()
'''
'''
def sum():
	ls=['123','sasa','1321','956']
	v = len(ls)
	i=0
	while i<v:
		for j in ls:
			print(j)
			if j == '1321':
				string='True'
				break
			elif i==(v-1):
				string='False'
		if string == 'True':
			return '正确'
			break
			
		else :
			return '错误'
		i+=1

var = sum()
print(var)

if __name__ == '__main__':
	sum()
	'''

'''
self = ('admin','123','17633619625','adhsite@qq.com')
v1=len(self)
#print('元组有%d组数据'%v1)
#print(self)
s=v1
s=str(s)
for j in self:
	s = s+','+j
print('s的类型:%s'%type(s))
print('j的类型:%s'%type(j))


n=s.find(',')
print(n)
k = s[:n]
k=int(k)
print(k)
l = s[(n+1):]
print(l)

ls=('',)
print(type(ls))
print(type(l))
i = 0
while i<k:
	n=l.find(',')
	if n==-1:
		ls = ls+(l[0:],)
		break
	else:
		ls = ls+(l[:n],)
		l=l[(n+1):]
		print(l,end='\n')
	i+=1
print(ls)
ls= ls[1:]
print(ls)
'''
'''
while i<v1:
	str1=str1[0:]+','+self[i]
print(str1)
print(str1.find(','))
'''
'''
while i<v1:
	
	s=str(len(self[i]))
	#print(type(s))
	str1 =str1[0:]+','+s
	print('第组元素字符个数为:%s'%s,end=' ')
	print(str1,end='\n')
	
	i+=1
	
l=len(str1)
for s in self:
	str1 = str1[0:]+s+','
	print(str1)
str2=str1[l:]
a=str2.find(',')
print(a)
'''


'''
from tkinter import *
#import tkinter as tk
import sign
def click(va):
	#print('点击位置:',va.x,va.y)
	print('按了Enter键')
	#print('敲击位置:',repr(va.char))
def dcn():
	sign = tk.Toplevel(win)
	sign.geometry('200x300')
	sign.title('注册')
	
win = Tk()
win.title('鼠标')
#frame = Frame(win,width=300,height=200)

sw = win.winfo_screenwidth()
sh = win.winfo_screenheight()
x = (sw-400)/2
y = (sh-300)/2
win.geometry('400x300+%d+%d'%(x,y))
Button(win,text='注册',command=sign.Register).pack()

win.mainloop()
'''
'''
import mysql.connector

mysqldb = mysql.connector.connect(user = 'admins',passwd = '123',host = 'localhost',database = 'user_system',buffered = True)#mysql服务器信息
mydb = mysqldb.cursor()#设置游标

#mydb.execute('DROP TABLE IF EXISTS user_information')

#mydb.execute("CREATE TABLE user_information(user_id INT(96) NOT NULL AUTO_INCREMENT,user_name VARCHAR(128) NOT NULL,user_passwd VARCHAR(128) NOT NULL,user_tel INT(15) NOT NULL,user_mail VARCHAR(128) NOT NULL,PRIMARY KEY (user_id))ENGINE = InnoDB")#创建数据表




mydb.close()

'''








